'''
    自助取款机
    1.主界面，登陆，退出
    2.查询余额
    3.取钱
    4.存钱
'''
#登陆
def LogIn():
    pass
# 取款机数据
m_list = [{'name':'','money':''}]
name = input('请输入姓名')
money = input('请输入金额')

# 查看余额
def show_m_info():
    if len(m_list)==0:
        print('='*20,'没有金额信息','='*20)
        return
    print('|{0:<5}|{1:<10}|{2:<5}|'.format('sid','name','money',))   #{位置信息：向左对齐空格留出几个}
    print('-'*40)
    for i,m_dict in enumerate (m_list):
        print('|{0:<5}|{1:<10}|{2:<5}|'.format(i+1,m_dict['name'],m_dict['money']))

# 3.存钱
def add_m (name,money):
        m_dict = {}
        m_dict['name'] = name
        m_dict['money'] = money
        m_list.append(m_dict)

# 4.取钱
def del_m(sid):
    sid_int = int(sid)
    m_list.pop(sid_int-1)

# 退出系统
def LogOut():
    pass

# 界面与交互
while True:
    # 输出一个初始界面
    print('='*12,'自助取款机','='*12)
    print('{:1} {:13} {:15}'.format(' ', '1登陆', '2.退卡'))
    print('='*40)
    key = input('请输入对应的选择')
    #根据输入操作值执行对应操作
    if key =='1':
        print('=' * 12, '自助取款机', '=' * 12)
        print('{:1} {:13} {:15}'.format(' ', '3.查余额', '4.存钱'))
        print('{:1} {:13} {:15}'.format(' ', '5.取钱','退出'))
        print('=' * 40)
        key1 = input('请输入对应的选择')
        if key1 == '3':
           print('=' * 12, '账户余额''=' * 12)
           show_m_info()
           input('按回车继续：')
        elif key1 =='4':
            print('='*12,'存钱','='*12)
            name = input('请输入姓名')
            age = input('请输入金额')
            add_m(name,age)
            show_m_info()
            input('按回车继续：')
        elif key1 == '5':
            print('='*12,'取钱','='*12)
            show_m_info()
            sid = input('请输入要取的账户sid')
            del_m(sid)
            show_m_info()
            input('按回车继续：')
        elif key1 =='6':
         LogOut()
         print('='*12,'再见','='*12)
         break
    else:
        print('='*12,'退卡','='*12)
        break